package com.zhuss.common;

import java.io.Serializable;
import java.util.List;

public class PageVo<T> implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -9083337235059227141L;

	private List<T> items;
	
	private Integer total;
	
	private Integer pageSize;
	
	private Integer pageNum;
	
	private Integer totalPage;

	public List<T> getItems() {
		return items;
	}

	public PageVo<T> setItems(List<T> items) {
		this.items = items;
		return this;
	}

	public Integer getTotal() {
		return total;
	}

	public PageVo<T> setTotal(Integer total) {
		this.total = total;
		return this;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public PageVo<T> setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
		return this;
	}

	public Integer getPageNum() {
		return pageNum;
	}

	public PageVo<T> setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
		return this;
	}

	public Integer getTotalPage() {
		if (total % pageSize == 0) {
			totalPage = total / pageSize;
		} else {
			totalPage = total / pageSize + 1;
		}
		return totalPage;
	}

	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}

}
